<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>当日情绪组合</title>
    <link rel="shortcut icon" href="favicon.ico"> <link href="/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">

    <link href="/css/animate.min.css" rel="stylesheet">
    <link href="/css/style.min.css?v=4.0.0" rel="stylesheet"><base target="_blank">
    <!-- Sweet Alert -->
    <link href="/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <!-- 弹窗-->
    <script src="../../tanchuan/js/jquery-2.0.0.min.js"></script>
    <link href="../../tanchuan/css/displaystyle.css" rel="stylesheet" />
    <script src="../../tanchuan/js/syntaxhighlighter_3.0.83/shCore.js"></script>
    <script src="../../tanchuan/js/syntaxhighlighter_3.0.83/shBrushJScript.js"></script>
    <link href="../../tanchuan/js/syntaxhighlighter_3.0.83/styles/shCoreRDark.css" rel="stylesheet" />
    <script src="../../tanchuan/js/NZ-Plugin/Js/NZ-Window.min.js"></script>
    <link href="../../tanchuan/js/NZ-Plugin/Css/NZ-Window.min.css" rel="stylesheet" />
    <script src="../../tanchuan/js/NZ-Plugin/Js/NZ-Drag.min.js"></script>
</head>
<style>
    @keyframes fade {
        from {
            opacity: 1.0;
        }
        50% {
            opacity: 0.0;
        }
        to {
            opacity: 1.0;
        }
    }
    @-webkit-keyframes fade {
        from {
            opacity: 1.00;
        }
        50% {
            opacity: 0;
        }
        to {
            opacity: 1.0;
        }
    }
    .headerBox {
        padding: 1px;
        animation: fade 1000ms infinite;
        -webkit-animation: fade 600ms infinite;

    }
</style>
<script>
    function startTime(){
        var today=new Date();
        var h=today.getHours();
        var m=today.getMinutes();
        var s=today.getSeconds();// 在小于10的数字前加一个‘0’
        m=checkTime(m);
        s=checkTime(s);
        document.getElementById('rockTime').innerHTML=h+":"+m+":"+s;
        var a=s+'';
        t=setTimeout(function(){startTime()},500);

        /**
         * 每格5s刷新一次个股信息
         */
        if(a.endsWith("0")  || a.endsWith("5")){
           // queryStock();
        }
    }
    function checkTime(i){
        if (i<10){
            i="0" + i;
        }
        return i;
    }
    function zhangTingBan(){
        $.NZ_Window.show({
            url: '/zhangTingBan',
            width: 1500,
            height: 1000,
            operate: {
                btn_Close: true, //关闭按钮
                btn_Max: true, //最大化按钮
                btn_Refresh: true, //刷新按钮
                btn_NewWindow: true, //新窗口按钮
                resize: true //调整窗口大小按钮
            }
        });
    }
</script>
<body class="gray-bg" onload="startTime()">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <H3>&nbsp; &nbsp; &nbsp;<a id="rockTime" style="font-size:25px;color:red;"></a>&nbsp; &nbsp; &nbsp; <a style="font-size:10px;">Tips：每一分钟自动刷新！</a></H3>
            <div class="col-sm-3">
                <div class="ibox">
                    <div class="ibox-content ">
                        <h5 class="m-b-md" style="font-size:20px;">上&nbsp;&nbsp;证</h5>
                        <h2 class="text-navy">
                            <a th:text="${sh.szzs}" style="font-size:40px;font-weight:bold;"/>   &nbsp;

                                </h2>
                        <small >
                            <i th:if="${sh.szxd} ge 0"  style="font-size:25px;font-weight:bold;">
                                <p style="font-family:arial;color:red;font-size:18px;" >上涨：&nbsp;&nbsp;<a th:text="${sh.szxd}+'%  &nbsp;&nbsp;' + ${sh.szxdsz}+'点  &nbsp;&nbsp;'+ ${sh.szcje/100000000}+'亿'"  style="font-size:16px;font-weight:bold;color:red;" /></p>
                            </i>
                            <i th:if="${sh.szxd} lt 0"  style="font-size:25px;font-weight:bold;">
                                <p style="font-family:arial;color:green;font-size:18px;" >下跌：&nbsp;&nbsp;<a th:text="${sh.szxd}+'%  &nbsp;&nbsp;' + ${sh.szxdsz}+'点  &nbsp;&nbsp;'+ ${sh.szcje/100000000}+'亿'"  style="font-size:16px;font-weight:bold;color:green;" /></p>
                            </i>
                        </small>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox">
                    <div class="ibox-content ">
                        <h5 class="m-b-md" style="font-size:20px;">深&nbsp;&nbsp;市</h5>
                        <h2 class="text-navy">
                            <a th:text="${sz.szzs}" style="font-size:40px;font-weight:bold;"/>   &nbsp;

                        </h2>
                        <small >
                            <i th:if="${sz.szxd} ge 0"  style="font-size:25px;font-weight:bold;">
                                <p style="font-family:arial;color:red;font-size:18px;" >上涨：&nbsp;&nbsp;<a th:text="${sz.szxd}+'%  &nbsp;&nbsp;' + ${sz.szxdsz}+'点  &nbsp;&nbsp;'+ ${sz.szcje/100000000}+'亿'"  style="font-size:16px;font-weight:bold;color:red;" /></p>
                            </i>
                            <i th:if="${sz.szxd} lt 0"  style="font-size:25px;font-weight:bold;">
                                <p style="font-family:arial;color:green;font-size:18px;" >下跌：&nbsp;&nbsp;<a th:text="${sz.szxd}+'%  &nbsp;&nbsp;' + ${sz.szxdsz}+'点  &nbsp;&nbsp;'+ ${sz.szcje/100000000}+'亿'"  style="font-size:16px;font-weight:bold;color:green;" /></p>
                            </i>
                        </small>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox">
                    <div class="ibox-content">
                        <h5 class="m-b-md" style="font-size:20px;">外资北上</h5>
                        <h2 class="text-danger">
                            <!--                                    <i class="fa fa-play fa-rotate-90"></i> 下降-->
                            <a th:text="${(hgt.hk2sh.dayNetAmtIn+hgt.hk2sz.dayNetAmtIn)/10000}+'亿'" style="font-size:40px;font-weight:bold;"/>   &nbsp;
                        </h2>
                        <small> <i th:if="${todayQinXuNow.yestodaySzAmountUp} ge 0"  style="font-size:18px;font-weight:bold;">
                            <p style="font-family:arial;color:red;font-size:18px;" >较昨日增加：&nbsp;&nbsp;<a th:text="${todayQinXuNow.yestodaySzAmountUp}+'%  &nbsp;&nbsp;' + ${todayQinXuNow.yestodaySzAmount}+'亿'"  style="font-size:16px;font-weight:bold;color:red;" /></p>
                        </i>
                            <i th:if="${todayQinXuNow.yestodaySzAmountUp} lt 0"  style="font-size:18px;font-weight:bold;">
                                <p style="font-family:arial;color:green;font-size:18px;" >较昨日減少：&nbsp;&nbsp;<a th:text="${todayQinXuNow.yestodaySzAmountDown}+'%  &nbsp;&nbsp;' + ${todayQinXuNow.yestodaySzAmount}+'亿'"  style="font-size:16px;font-weight:bold;color:green;" /></p>
                            </i> </small>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox">
                    <div class="ibox-content">
                        <h5 class="m-b-md" style="font-size:20px;">国内主力资金</h5>
                        <h2 class="text-danger">
                            <!--                                    <i class="fa fa-play fa-rotate-90"></i> 下降-->
                            <a th:text="${todayQinXuNow.szTradeSum}+'亿'" style="font-size:40px;font-weight:bold;"/>   &nbsp;
                        </h2>
                        <small> <i th:if="${todayQinXuNow.yestodaySzAmountUp} ge 0"  style="font-size:18px;font-weight:bold;">
                            <p style="font-family:arial;color:red;font-size:18px;" >较昨日增加：&nbsp;&nbsp;<a th:text="${todayQinXuNow.yestodaySzAmountUp}+'%  &nbsp;&nbsp;' + ${todayQinXuNow.yestodaySzAmount}+'亿'"  style="font-size:16px;font-weight:bold;color:red;" /></p>
                        </i>
                            <i th:if="${todayQinXuNow.yestodaySzAmountUp} lt 0"  style="font-size:18px;font-weight:bold;">
                                <p style="font-family:arial;color:green;font-size:18px;" >较昨日減少：&nbsp;&nbsp;<a th:text="${todayQinXuNow.yestodaySzAmountDown}+'%  &nbsp;&nbsp;' + ${todayQinXuNow.yestodaySzAmount}+'亿'"  style="font-size:16px;font-weight:bold;color:green;" /></p>
                            </i> </small>
                    </div>
                </div>
            </div>

        </div>
        <div class="row">

            <div class="col-lg-4">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>用户行为统计</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-xs-4">
                            <small class="stats-label">访问页面 / 浏览量</small>
                            <h4>236 321.80</h4>
                        </div>

                        <div class="col-xs-4">
                            <small class="stats-label">% 新访客</small>
                            <h4>46.11%</h4>
                        </div>
                        <div class="col-xs-4">
                            <small class="stats-label">最后一周</small>
                            <h4>432.021</h4>
                        </div>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-xs-4">
                            <small class="stats-label">访问页面 / 浏览量</small>
                            <h4>643 321.10</h4>
                        </div>

                        <div class="col-xs-4">
                            <small class="stats-label">% 新访客</small>
                            <h4>92.43%</h4>
                        </div>
                        <div class="col-xs-4">
                            <small class="stats-label">最后一周</small>
                            <h4>564.554</h4>
                        </div>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-xs-4">
                            <small class="stats-label">访问页面 / 浏览量</small>
                            <h4>436 547.20</h4>
                        </div>

                        <div class="col-xs-4">
                            <small class="stats-label">% 新访客</small>
                            <h4>150.23%</h4>
                        </div>
                        <div class="col-xs-4">
                            <small class="stats-label">最后一周</small>
                            <h4>124.990</h4>
                        </div>
                    </div>
                </div>
            </div>
        </div>
            <div class="col-lg-4">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>用户行为统计</h5>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <div class="col-xs-4">
                                <small class="stats-label">访问页面 / 浏览量</small>
                                <h4>236 321.80</h4>
                            </div>

                            <div class="col-xs-4">
                                <small class="stats-label">% 新访客</small>
                                <h4>46.11%</h4>
                            </div>
                            <div class="col-xs-4">
                                <small class="stats-label">最后一周</small>
                                <h4>432.021</h4>
                            </div>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <div class="col-xs-4">
                                <small class="stats-label">访问页面 / 浏览量</small>
                                <h4>643 321.10</h4>
                            </div>

                            <div class="col-xs-4">
                                <small class="stats-label">% 新访客</small>
                                <h4>92.43%</h4>
                            </div>
                            <div class="col-xs-4">
                                <small class="stats-label">最后一周</small>
                                <h4>564.554</h4>
                            </div>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <div class="col-xs-4">
                                <small class="stats-label">访问页面 / 浏览量</small>
                                <h4>436 547.20</h4>
                            </div>

                            <div class="col-xs-4">
                                <small class="stats-label">% 新访客</small>
                                <h4>150.23%</h4>
                            </div>
                            <div class="col-xs-4">
                                <small class="stats-label">最后一周</small>
                                <h4>124.990</h4>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-lg-4">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>用户行为统计</h5>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <div class="col-xs-4">
                                <small class="stats-label">访问页面 / 浏览量</small>
                                <h4>236 321.80</h4>
                            </div>

                            <div class="col-xs-4">
                                <small class="stats-label">% 新访客</small>
                                <h4>46.11%</h4>
                            </div>
                            <div class="col-xs-4">
                                <small class="stats-label">最后一周</small>
                                <h4>432.021</h4>
                            </div>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <div class="col-xs-4">
                                <small class="stats-label">访问页面 / 浏览量</small>
                                <h4>643 321.10</h4>
                            </div>

                            <div class="col-xs-4">
                                <small class="stats-label">% 新访客</small>
                                <h4>92.43%</h4>
                            </div>
                            <div class="col-xs-4">
                                <small class="stats-label">最后一周</small>
                                <h4>564.554</h4>
                            </div>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <div class="col-xs-4">
                                <small class="stats-label">访问页面 / 浏览量</small>
                                <h4>436 547.20</h4>
                            </div>

                            <div class="col-xs-4">
                                <small class="stats-label">% 新访客</small>
                                <h4>150.23%</h4>
                            </div>
                            <div class="col-xs-4">
                                <small class="stats-label">最后一周</small>
                                <h4>124.990</h4>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>

        <div class="row">

            <div class="col-lg-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>自定义响应表格</h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a href="#">设置选项1</a>
                                </li>
                                <li><a href="#">设置选项2</a>
                                </li>
                            </ul>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <div class="col-sm-9 m-b-xs">
                                <div data-toggle="buttons" class="btn-group">
                                    <label class="btn btn-sm btn-white">
                                        <input type="radio" id="option1" name="options">天</label>
                                    <label class="btn btn-sm btn-white active">
                                        <input type="radio" id="option2" name="options">周</label>
                                    <label class="btn btn-sm btn-white">
                                        <input type="radio" id="option3" name="options">月</label>
                                </div>
                            </div>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input type="text" placeholder="搜索" class="input-sm form-control"> <span class="input-group-btn">
                                        <button type="button" class="btn btn-sm btn-primary">搜索</button> </span>
                                </div>
                            </div>
                        </div>
                        <div class="table-responsive">
                            <table class="table table-striped">
                                <thead>
                                <tr>
                                    <th>项目</th>
                                    <th>进度</th>
                                    <th>任务</th>
                                    <th>日期</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr>
                                    <td>米莫说｜MiMO Show</td>
                                    <td><span class="pie">0.52/1.561</span>
                                    </td>
                                    <td>20%</td>
                                    <td>2014.11.11</td>
                                    <td><a href="table_basic.html#"><i class="fa fa-check text-navy"></i></a>
                                    </td>
                                </tr>
                                <tr>
                                    <td>商家与购物用户的交互试衣应用</td>
                                    <td><span class="pie">6,9</span>
                                    </td>
                                    <td>40%</td>
                                    <td>2014.11.11</td>
                                    <td><a href="table_basic.html#"><i class="fa fa-check text-navy"></i></a>
                                    </td>
                                </tr>
                                <tr>
                                    <td>天狼---智能硬件项目</td>
                                    <td><span class="pie">3,1</span>
                                    </td>
                                    <td>75%</td>
                                    <td>2014.11.11</td>
                                    <td><a href="table_basic.html#"><i class="fa fa-check text-navy"></i></a>
                                    </td>
                                </tr>
                                <tr>
                                    <td>线下超市+线上商城+物流配送互联系统</td>
                                    <td><span class="pie">4,9</span>
                                    </td>
                                    <td>18%</td>
                                    <td>2014.11.11</td>
                                    <td><a href="table_basic.html#"><i class="fa fa-check text-navy"></i></a>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>

                    </div>
                </div>
            </div>

        </div>

        <form id="form1" method="post" action="/addStock">
            <input type="hidden" id="addCode" name="code" value="">
            <input type="hidden" id="addDesc" name="desc" value="">
        </form>
    </div>
<!--    <script src="/js/jquery.min.js?v=2.1.4"></script>-->
    <script src="/js/bootstrap.min.js?v=3.3.5"></script>
    <script src="/js/plugins/sparkline/jquery.sparkline.min.js"></script>
    <script src="/js/plugins/peity/jquery.peity.min.js"></script>
    <script src="/js/content.min.js?v=1.0.0"></script>
    <script src="/js/demo/peity-demo.min.js"></script>
    <script src="/js/plugins/gritter/jquery.gritter.min.js"></script>
    <script src="/js/plugins/sweetalert/sweetalert.min.js"></script>
    <script th:inline="javascript">
        $(document).ready(function () {
            var zhangTingList= [[${zhangTingList}]];
            var dieTingList= [[${dieTingList}]];
            var szList= [[${szList}]];
            var xdList= [[${xdList}]];
            var zhangTingHistory= [[${zhangTingHistory}]];
            var dieTingHistory= [[${dieTingHistory}]];
            var todayQinXuNow= [[${todayQinXuNow}]];

            var szAmountList= [[${szAmountList}]];

            /**  warn */
            if (todayQinXuNow.yestodayZhangTingWarn >= 90 || todayQinXuNow.yestodayZhangTingWarn <= 50) {
                $('#zhangTingWarn').addClass("headerBox");
                // $.gritter.add({
                //     title: "您有2条未读信息",
                //     text: '请前往<a href="mailbox.html" class="text-warning">收件箱</a>查看今日任务',
                //     time: 10000
                // })
            }
            if (todayQinXuNow.ztzs < todayQinXuNow.yestodayMinUpNum) {
                $('#shangZhangWran').addClass("headerBox");
            }

            $("#sparkline1").sparkline( zhangTingList,
                {
                type: "line",
                width: "100%",
                height: "60",
                lineColor: "#ed5565",
                fillColor: "#ffffff"
            });
            $("#sparkline2").sparkline(dieTingList, {
                type: "line",
                width: "100%",
                height: "60",
                lineColor: "#1ab394",
                fillColor: "#ffffff"
            });
            $("#sparkline3").sparkline(szList, {
                type: "line",
                width: "100%",
                height: "60",
                lineColor: "#ed5565",
                fillColor: "#ffffff"
            });
            $("#sparkline4").sparkline(xdList, {
                type: "line",
                width: "100%",
                height: "60",
                lineColor: "#1ab394",
                fillColor: "#ffffff"
            });
            $("#sparkline10").sparkline( zhangTingHistory,
                {
                    type: "line",
                    width: "100%",
                    height: "60",
                    lineColor: "#ed5565",
                    fillColor: "#ffffff"
                });
            $("#sparkline11").sparkline( dieTingHistory,
                {
                    type: "line",
                    width: "100%",
                    height: "60",
                    lineColor: "#1ab394",
                    fillColor: "#ffffff"
                });
            $("#sparkline13").sparkline( szAmountList,
                {
                    type: "line",
                    width: "100%",
                    height: "60",
                    lineColor: "#ed5565",
                    fillColor: "#ffffff"
                });

            $("#sparkline5").sparkline([1, 4], {type: "pie", height: "140", sliceColors: ["#1ab394", "#F5F5F5"]});
            $("#sparkline6").sparkline([5, 3], {type: "pie", height: "140", sliceColors: ["#1ab394", "#F5F5F5"]});
            $("#sparkline7").sparkline([2, 2], {type: "pie", height: "140", sliceColors: ["#ed5565", "#F5F5F5"]});
            $("#sparkline8").sparkline([2, 3], {type: "pie", height: "140", sliceColors: ["#ed5565", "#F5F5F5"]})

        });

        function ajaxStock(companyCodes) {
            $.ajax({
                url : '/ajaxRequestGetList',
                type : "post",
                data:{"code":companyCodes},
                success : function(result){
                    $.each(JSON.parse(result), function(idx, data) {
                       // var code1=$.parseJSON(data);
                        var code1=data;
                        var code=code1.code;
                        var zhangdie=code1.zhangdie;
                        var idCode = "#code_" +code;
                        var idZhangDie = "#zd_"+code;
                        var idName = "#name_" + code;
                        var warnCode = "#warn_" + code;
                        if(zhangdie>0){
                            $(idZhangDie).css({"color":"red","font-size":"20px"});
                            $(idName).css({"color":"red","font-size":"20px"});
                            $(idCode).css({"font-size":"10px"});
                        }
                        if(zhangdie < 0){
                            $(idZhangDie).css({"color":"green","font-size":"20px"});
                            $(idName).css({"color":"green","font-size":"20px"});
                            $(idCode).css({"font-size":"10px"});
                            if (zhangdie < -2) {
                                //  $(warnCode).css({"border": "3px solid red"});
                                $(idZhangDie).addClass("headerBox");
                            }
                        }
                        $(idZhangDie).html(zhangdie+"%");
                    });

                }
            });
        }

    </script>
    <script  th:inline="javascript">
        //
        var todayQinXuNow = [[${todayQinXuNow}]];

        function removeWarn(warnCode) {
            //
            //$(warnCode).removeClass("headerBox");
            if ('shangZhangWran' == warnCode.id) {
                swal({title: todayQinXuNow.yestodayMaxUpNumWarn, text: ""})
            }
        }
        //Ajax请求后台数据
        function myrefresh() {
            window.location.reload();
        }

        setTimeout('myrefresh()', 60000); //指定1分钟刷新一次
        var companyStocksListPartA = [[${companyStocksList_part_A}]];
        var companyStocksListPartB = [[${companyStocksList_part_B}]];
        var companyStocksListPartC = [[${companyStocksList_part_C}]];

        /**
         * 初始化
         * */
        // setTimeout('queryDataTimer(companyStocksListPartA)', 500);
        // setTimeout('queryDataTimer(companyStocksListPartB)', 500);
        // setTimeout('queryDataTimer(companyStocksListPartC)', 500);

        /**
         * 通過時鐘控制
         * */
        function queryStock()
        {
            queryDataTimer(companyStocksListPartA);
            queryDataTimer(companyStocksListPartB);
            queryDataTimer(companyStocksListPartC);
        }

        /**
         * 请求信息
         * */
         function queryDataTimer(companyStocksList) {
            var arrayObj = new Array();
            for (var i = 0; i < companyStocksList.length; i++) {
                var companyCode = companyStocksList[i].companyCode;
                if(companyCode != null || companyCode != ""){
                    arrayObj.push(companyCode);
                }
            }
            ajaxStock(arrayObj.toString());
        }
         /**
         * 添加
         * */
        function handleClick() {
            var code = $("#codeName").val();
            if (code == null || code == "" || code.length != 6) {
                if (code.length != 6) {
                    alert("请输入正确的股票代码");
                } else {
                    alert("请输入股票代码");
                }
            } else {
                if (code.startsWith("6", 0)) {
                    code = "sh" + code;
                } else {
                    code = "sz" + code;
                }
                $.ajax({
                    url: '/ajaxRequest',
                    type: "get",
                    data: {"code": code},
                    success: function (data) {
                        var code1 = $.parseJSON(data);
                        var code = code1.code;
                        var desc = prompt("请输入备注描述：", code1.gpname);
                        $("#addCode").val(code);
                        $("#addDesc").val(desc);
                        handleClickAjax(code, desc);
                    },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        alert("查询失败，请检查股票代码！");
                    },
                });
            }
        }

        /**
         * 添加
         * @param code
         * @param desc
         */
        function handleClickAjax(code, desc) {
            $.ajax({
                url: '/addStock',
                type: "get",
                data: {"code": code, "desc": desc},
                success: function (data) {
                    window.location.reload();
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    alert("查询失败，请检查股票代码！");
                },
            });
        }

        /**
         * 删除
         * @param code
         * @param desc
         */
        function delStock(stockId) {
            $.ajax({
                url: '/delStock',
                type: "get",
                data: {"id": stockId},
                success: function (data) {
                    swal({title: data, text: ""});
                    window.location.reload();
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    alert("删除失败，请联系管理员！");
                },
            });
        }

        /**
         * 置顶关注
         * @param code
         * @param desc
         */
        function zhiDingStock(stockId) {
            $.ajax({
                url: '/zhiDingStock',
                type: "get",
                data: {"id": stockId},
                success: function (data) {
                    alert(data);
                    window.location.reload();
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    alert("设置失败，请联系管理员！");
                },
            });
        }

        function removeCompanyWarn(object)
        {
            var id=object.id;
            swal({title: "跌幅超过2%！", text: ""});
            $(object).removeClass("headerBox");
        }
    </script>
</body>

</html>